Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure device tracker #23862

Merged
merged 6 commits into from
May 15, 2019
Merged

Restructure device tracker #23862

merged 6 commits into from
May 15, 2019

Conversation

balloob
Copy link
Member

@balloob balloob commented May 14, 2019

Description:

Restructure the device tracker to make it easier to add EntityPlatform support.

This PR is a first step in an overhaul that will supersede the overhaul in #21151. The plan is to do #21151 but in smaller steps + make it that instead of overhauling everything at once, we will introduce it in a way that new platforms will use EntityPlatform, while the old ones remain using the legacy code.

Once the overhaul is complete, we will no longer accept contributions using the old style. Important platforms will be migrated to use the EntityPlatform.

Related issue (if applicable): home-assistant/architecture#151

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.



@callback
def async_setup_scanner_platform(hass: HomeAssistantType, config: ConfigType,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only for the legacy type, right? Should we move it to legacy?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future PR 👍

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a quick read, I think this looks great!

@balloob balloob merged commit 70ed58a into dev May 15, 2019
@delete-merged-branch delete-merged-branch bot deleted the device-tracker-prepare branch May 15, 2019 21:43
@balloob balloob mentioned this pull request Jun 4, 2019
alandtse pushed a commit to alandtse/home-assistant that referenced this pull request Oct 12, 2019
* Restructure device tracker

* Docstyle

* Fix typing

* Lint

* Lint

* Fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants